// 导入数据库操作模块
import db from '../../db/index'

// 获取所有用户信息
export const getAllUserInfo = (req, res) => {
    // 1 代表未删除  0代表删除
    const sql = `select * from user_detail where u_state=1 and ua_id=10001`
    db.query(sql, (err, results) => {
        if (err) return res.operationFailed(err)
        let userInfo = [ ...results ]
        for (const key in userInfo) {
            delete userInfo[key].password
            delete userInfo[key].u_state
            delete userInfo[key].security_question
        }
        res.operationSuccess('success', '', '获取用户信息成功！', userInfo)
    })
}